package proxy;

import java.lang.reflect.Method;

public class Advice implements InvocationHandler1 {
	
    People people;//接口，传进来实例
    
    public Advice(People people) {
        this.people = people;
    }
    
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        //前置增强
        before();
        //被代理方
        Object value = method.invoke(people,args);
        //后置增强
        after();
        return value;
    }

    private void before() {
        System.out.println("===========jack吃饭之前�?要洗�?==========");
    }

    private void after() {
        System.out.println("===========jack吃完饭要洗碗=============");
    }
}
